#include <cad-slicer/load.h>
#include <cad-slicer/save.h>

#include <cassert>

#include <boost/archive/text_iarchive.hpp>
#include <boost/archive/text_oarchive.hpp>

#include <cad-slicer/slicer-parameters.h>
#include <cad-slicer/slice.h>


#define SERIALIZATION(_type) \
  namespace boost { namespace serialization { \
  template <class _Archive> void serialize(_Archive & archive, _type& what, const unsigned int version); }} \
  bool cadslicer::load(std::istream* stream, _type* what) { assert(stream); assert(what); boost::archive::text_iarchive ia(*stream); ia >> *what; return true; } \
  bool cadslicer::save(std::ostream* stream, _type const& what) { assert(stream); boost::archive::text_oarchive oa(*stream); oa << what; return true; } \
  template <class _Archive> void boost::serialization::serialize(_Archive & archive, _type& what, const unsigned int version)


SERIALIZATION(cadslicer::slicer_parameters)
{
  archive & what.step;
  archive & what.post_process;
}


SERIALIZATION(cadslicer::slice)
{

}
